package com.lineage.data.item_etcitem.add;

import com.lineage.data.executor.ItemExecutor;
import com.lineage.server.model.Instance.L1ItemInstance;
import com.lineage.server.model.Instance.L1PcInstance;
import com.lineage.server.serverpackets.S_OwnCharStatus2;
import com.lineage.server.serverpackets.S_ServerMessage;
import com.lineage.server.serverpackets.ServerBasePacket;

public class Nostrumcon_new extends ItemExecutor {
  private int a;
  
  public static ItemExecutor get() {
    return new Nostrumcon_new();
  }
  
  public final void execute(int[] data, L1PcInstance pc, L1ItemInstance item) {
    try {
      int i = pc.getBaseCon();
      while (i < this.a) {
        pc.addBaseCon(1);
        i++;
      } 
      i = pc.getBaseWis();
      while (i < this.a) {
        pc.addBaseWis(1);
        i++;
      } 
      i = pc.getBaseStr();
      while (i < this.a) {
        pc.addBaseStr(1);
        i++;
      } 
      i = pc.getBaseInt();
      while (i < this.a) {
        pc.addBaseInt(1);
        i++;
      } 
      i = pc.getBaseCha();
      while (i < this.a) {
        pc.addBaseCha(1);
        i++;
      } 
      i = pc.getBaseDex();
      while (i < this.a) {
        pc.addBaseDex(1);
        i++;
      } 
      pc.sendPackets((ServerBasePacket)new S_OwnCharStatus2(pc));
      pc.save();
      pc.getInventory().removeItem(item, 1L);
      pc.sendPackets((ServerBasePacket)new S_ServerMessage("服用后请登出后在进来"));
    } catch (Exception exception) {}
  }
  
  public void set_set(String[] set) {
    this.a = Integer.parseInt(set[1]);
  }
}
